package com.neusoft.yiyang.task.client;

import com.neusoft.yiyang.common.entity.care.CareItem;
import com.neusoft.yiyang.common.entity.care.CustomerCareItem;
import com.neusoft.yiyang.common.enums.ExecutionStatus;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@FeignClient(name = "care-service")
public interface CareClient {

    // 完成护理记录并更新使用情况
    @PostMapping(value = "/customer-care-items/complete-with-usage",
            consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    void completeCareRecordWithUsageUpdate(
            @RequestParam("customerId") Integer customerId,
            @RequestParam("careItemId") Integer careItemId,
            @RequestParam("caretakerId") Integer caretakerId,
            @RequestParam("quantity") Integer quantity,
            @RequestParam("feedback") String feedback,
            @RequestParam("status") ExecutionStatus status,
            @RequestPart(value = "file", required = false) MultipartFile file
    );

    // 获取客户有效的护理项目
    @GetMapping("/customer-care-items/by-customer/{customerId}")
    List<CustomerCareItem> getCustomerCareItemsByCustomerId(@PathVariable Integer customerId);

    // 根据ID获取护理项目详情
    @GetMapping("/care-items/{careItemId}")
    CareItem getCareItemById(@PathVariable Integer careItemId);
}